package com.example.warehousewms.controller;

import com.example.warehousewms.bean.vo.StockOutOrderVo;
import com.example.warehousewms.common.R;
import com.example.warehousewms.service.StockOutOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class StockOutOrderController {

    @Autowired
    StockOutOrderService stockOutOrderService;

    @PostMapping("/stockOutOrder")
    public R createStockOutOrder(@RequestBody StockOutOrderVo stockOutOrderVo){
        stockOutOrderService.createStockOutOrder(stockOutOrderVo);
        return R.ok();
    }

    @PutMapping("/stockOutOrder")
    public R updateStockOutOrder(@RequestBody StockOutOrderVo stockOutOrderVo){
        stockOutOrderService.updateStockOutOrder(stockOutOrderVo);
        return R.ok();
    }

    @PutMapping("/stockOutOrder/{id}")
    public R finishStockOutOrder(@PathVariable Long id){
        stockOutOrderService.finishStockOutOrder(id);
        return R.ok();
    }


}
